package com.zcx.medicalnote;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.cbs.android.component.log.L;
import com.cbs.android.component.push.jpush.JPush;
import com.cbs.android.component.push.pushinterface.PushHandler;
import com.cbs.android.component.push.pushinterface.PushInterface;


public class MainActivity extends AppCompatActivity {
    private static final String TAG = MainActivity.class.getName();
    private PushInterface pushInterface;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        pushInterface = new JPush(this);
        pushInterface.addPushHandler(new PushHandler() {
            @Override
            public void onPushTokenReceived(String s) {
                L.e(TAG, "token: " + s);
            }

            @Override
            public void onMessageReceived(Context context, Bundle bundle) {
                L.e(TAG, "new message");
            }

            @Override
            public void onNotificationOpen(Context context, Bundle bundle) {
                L.e(TAG, "open notification");
            }
        });
    }
}
